package com.gx.recruitment.service.impl;

import com.gx.recruitment.entity.Comp_info;
import com.gx.recruitment.entity.Comp_infoExample;
import com.gx.recruitment.mapper.Comp_infoMapper;
import com.gx.recruitment.service.CompService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CompServiceImpl implements CompService {
    @Resource
    private Comp_infoMapper comp_infoMapper;

    @Override
    public int insertComp(Comp_info record) {
        comp_infoMapper.insert(record);
        return 0;
    }

    @Override
    public List<Comp_info> findbyCompName(String compname) {
        Comp_infoExample example = new Comp_infoExample();
        Comp_infoExample.Criteria cri = example.createCriteria();
        cri.andCompNameEqualTo(compname);
        return comp_infoMapper.selectByExample(example);
    }


    @Override
    public List<Comp_info> loginComp(String compname, String comppass) {
        Comp_infoExample example = new Comp_infoExample();
        Comp_infoExample.Criteria cri = example.createCriteria();
        cri.andCompNameEqualTo(compname);
        cri.andCompPassEqualTo(comppass);
        return comp_infoMapper.selectByExample(example);
    }
}
